﻿#include "HellKnight.h"
#include "../../../Shared/ServerPackets.h"

using namespace Server::MirDatabase;
using namespace Server::MirEnvir;
namespace S = ServerPackets;

namespace Server::MirObjects::Monsters
{

    HellKnight::HellKnight(MonsterInfo *info) : MonsterObject(info)
    {
    }

    void HellKnight::Spawned()
    {
        MonsterObject::Spawned();

        Summoned = true;
    }

    void HellKnight::Die()
    {
        if (Lord != nullptr)
        {
            Lord->KnightKilled();
        }

        MonsterObject::Die();
    }

    Packet *HellKnight::GetInfo()
    {
        S::ObjectMonster *tempVar = new S::ObjectMonster();
        tempVar->ObjectID = ObjectID;
        tempVar->Name = getName();
        tempVar->NameColour = NameColour;
        tempVar->Location = getCurrentLocation();
        tempVar->Image = Info->Image;
        tempVar->Direction = getDirection();
        tempVar->Effect = Info->Effect;
        tempVar->AI = Info->AI;
        tempVar->Light = Info->Light;
        tempVar->Dead = Dead;
        tempVar->Skeleton = Harvested;
        tempVar->Poison = CurrentPoison;
        tempVar->Hidden = getHidden();
        tempVar->Extra = Summoned;

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar' statement was not added since tempVar was used in a 'return' or 'throw' statement.
        return tempVar;
    }
}
